﻿using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
using System.Data.Entity.Infrastructure.Interception;
using Yz.Core.DBUtility;
using Yz.Mvc.Authentication;
using Yz.Web;

[assembly: OwinStartup(typeof(Startup))]
namespace Yz.Web
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            //开启EF数据追踪
            DbInterception.Add(new EFDbLogger());
            // 使应用程序可以使用 Cookie 来存储已登录用户的信息
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = AuthTypes.AppYz
            });
            app.RegisterAutofac();
        }
    }
}